package itdfq.dfq.Creational_Pattern.yuanxingmoshi;



import java.io.*;

/**
 * @Author GocChin
 * @Date 2021/3/28 10:26
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
public class PPT implements Serializable {
    private Fujian fujian = null;
    public PPT() {
        this.fujian = new Fujian();
    }
    public Object deepClone() throws Exception {
        //讲对象写入流中
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
        objectOutputStream.writeObject(this);
        //从流中取出
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
        ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
        return (objectInputStream.readObject());
    }
    public Fujian getFujian(){
        return this.fujian;
    }
    public void use(){
        System.out.println("查看PPT");
    }
}






